package com.netx.ebs;


class ApplicationStateChecker implements SecurityChecker {

	public ApplicationStateChecker() {
	}

	public void check(EbsRequest request, EbsResponse response) throws SecurityCheckException {
		if(request.getServletContext().getAttribute(Constants.SRVCTX_ERROR_LIST) != null) {
			throw new ApplicationNotInitializedException();
		}
		else if(request.getEbsContext().getApplicationState() == APPLICATION_STATE.STOPPED) {
			throw new ApplicationStoppedException();
		}
	}
}
